<?php
/**
 * Created by PhpStorm.
 * User: wliu
 * Date: 14-3-19
 * Time: 下午2:42
 */

class UserActionlog extends EMongoDocument {
    public $deviceid;
    public $userid;
    public $event;
    public $entityObject;
    public $createTime;
    public $entityType;

    /**
     * This method have to be defined in every Model
     * @return string MongoDB collection name, witch will be used to store documents of this model
     */
    public function getCollectionName()
    {
        return 'user_actionlog';
    }

    // We can define rules for fields, just like in normal CModel/CActiveRecord classes
    public function rules()
    {
        return array(

        );
    }

    // the same with attribute names
    public function attributeNames()
    {
        return array(
            'userid'=>'userid',
            'event'=>'event',
            'entityObject'=>'entityObject',
            'createTime'=>'createTime',
            '$deviceid’=>‘$deviceid',
            'entityType'=>'entityType',
            '_id'=>"_id",
        );
    }


    /**
     * This method have to be defined in every model, like with normal CActiveRecord
     */
    public static function model($className=__CLASS__)
    {
        return parent::model($className);
    }
} 